// https://codeforces.com/contest/576/problem/A

#include <iostream>
using namespace std;
const int N = 1010;
int prime[N], idx;
bool flag[N];
int n;

int main()
{
    cin >> n;
    for(int i = 2; i <= n; ++i)
    {
        if(!flag[i]) prime[idx++] = i;
        for(int j = 0; prime[j] <= n / i; ++j)
        {
            flag[prime[j] * i] = true;
            if(i % prime[j] == 0) break;
        }
    }
    int tt = idx;
    for(int i = 0; i < tt; ++i)
    {
        int tmp = prime[i] * prime[i];
        while(tmp <= n)
        {
            prime[idx++] = tmp;
            tmp *= prime[i];
        }
    }
    cout << idx << endl;
    for(int i = 0; i < idx; ++i)
        cout << prime[i] << ' ';
    cout << endl;
    return 0;
}